package com.base.components.common.doc.validation;

/**
 * EL 用于效验请求参数的 Spring EL 表达式
 *
 * @author <a href="drakelee1221@gmail.com">LiGeng</a>
 * @version v1.0.0
 * @date 2019-01-03 9:01
 */
public interface EL {

  String THIS = "#this";

  /** 类型是否正确 */
  String CHECK_TYPE = THIS + " != NULL ";

  /** 不是空白字符 */
  String NOT_BLANK = " T(org.apache.commons.lang3.StringUtils).isNotBlank(" + THIS + ".toString()) ";

  /** 是否整数 */
  String INTEGER = THIS + " matches '-?[0-9]*' ";

  /** 是否数字 */
  String NUMBER =  THIS + " matches '-?[0-9]+.?[0-9]+' ";

  /** 大于 */
  String GREATER =  THIS + " > ";

  /** 大于等于 */
  String GREATER_EQUAL =  THIS + " >= ";

  /** 小于 */
  String LESS =  THIS + " < ";

  /** 小于等于 */
  String LESS_EQUAL =  THIS + " <= ";

  /** 不等于 */
  String NOT_EQUAL =  THIS + " != ";

  /** 集合是否包含，集合可以直接用大括号表示，如： {1,2,3} */
  String CONTAINS = ".contains(" + THIS + ")";

}
